package com.topgay.controller.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.topgay.domain.TestMember;
import com.topgay.service.board.TestService;
/*
 * 처음 테스트 할때 만든 컨트롤러입니다. 지워도 무방합니당
 * 
 * by 한지수
 * 
 * 20141029_01
 * 
 */
@Controller
@RequestMapping("/board/")
public class TestController {
	
	@Autowired
	private TestService service;
	
	
	@RequestMapping(value="test.do", method=RequestMethod.GET)
	public String joinMember(TestMember member){
		service.insertMember(member);
		
		return "noSide.test/test";
	}
	
	@RequestMapping(value="test2.do", method=RequestMethod.GET)
	public ModelAndView selectMember(String name){
		TestMember member = service.selectMember(name);
		return new ModelAndView("noSide.test/test2", "member", member);
	}
}
